#include "library/libdatetimehelper.h"
#include "library/libdatetime.h"

using namespace basic::library2;
using namespace std;

CDateTime *CDateTimeHelper::DiffTime(const CDateTime& oDateTime1, const CDateTime& oDateTime0)
{
	return NULL;
}

std::string CDateTimeHelper::GetRFC822DateStr(const CDateTime& oDateTime)
{
	char sInnerBuffer[1024] = {0};
    if (apr_rfc822_date(sInnerBuffer, oDateTime.GetRawTimeStamp())==APR_SUCCESS)
	{
		return string(sInnerBuffer);
	}
	return "";
}

std::string CDateTimeHelper::GetCTimeStr(const CDateTime& oDateTime)
{
	char sInnerBuffer[1024] = {0};
	if (apr_ctime(sInnerBuffer, oDateTime.GetRawTimeStamp())==APR_SUCCESS)
	{
		return string(sInnerBuffer);
	}
	return "";
}

